package com.dylan.历史.guava;

import com.google.common.base.Splitter;
import com.google.common.collect.Lists;

import java.util.ArrayList;

/**
 * @author : ankang
 * @date : 2019/10/21 18:41
 * @Description :
 */
public class 分割字符串 {

    /**
     * https://www.jianshu.com/p/fdd4204d580a
     */
    public static void main(String[] args) {
        String s = " ,a b , c ,d, ";
        ArrayList<String> l = Lists.newArrayList(Splitter.on(",").omitEmptyStrings().trimResults().split(s));
        System.out.println(l.size());
        System.out.println(l);
    }
}
